<%@page import="com.ambow.Entity.DeliverToStudent"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ambow.utils.*"%>
<%@page import="com.ambow.Entity.*"%>
<%@page import="org.hibernate.*"%>
<%@page import="com.ambow.service.impl.*"%>
<%@page import="com.ambow.service.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Keywords" content="关键词1,关键词2，关键词3,关键词4,……" />
<meta name="Description" content="你网页的简述" />
<meta name="Robots" content="All" />
<meta name="Generator" content="Dreamweaver" />
<title>学生出库查询</title>
<link href="<%=path %>/static/css/css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
<link rel="stylesheet" href="/resources/demos/style.css"/>
<script src="https://code.jquery.com/jquery-1.12.4.js "></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js "></script>
<script>
$( function() {
    $( "#deliverDatefrm" ).datepicker({ dateFormat: 'yy-mm-dd' });
    $( "#deliverDateto" ).datepicker({ dateFormat: 'yy-mm-dd' });
  } );
</script>
<style type="text/css">
<!--
.style1 {
	color: #FF0000
}
-->
</style>
<script>
			function yan() {
				if (form2.deliverDatefrm.value == "") {
					alert("开始查询时间不能为空！");//弹出提示框
					document.form2.deliverDatefrm.focus();//获取鼠标焦点
					return (false);
				} else if (form2.deliverDateto.value == "") {
					alert("结束查询时间不能为空！");
					document.form2.deliverDateto.focus();
					return (false);
				}
			}
		</script>
</head>

<body>
	<h3 id="subTitle">学生出库信息查询</h3>
	<form action="<%=path%>/DeliverToStudentServlet?status=queryDeliverToStudent" method="post" name="form2" onsubmit="return yan()">

		<table width="90%" border="0" align="center" cellpadding="0"
			cellspacing="0" class="table2">
			<%--<tr>
				<td nowrap="nowrap">类别： <select name="category">
						<%Session seCategory= HibernateUtil.getSession();
				List<Category> clist =seCategory.createQuery("from Category").list();
				 HibernateUtil.clossSession(); 
				 for(int j=0;j<clist.size();j++){%>
					 <option selected="selected" value="<%=clist.get(j).getId()%>" ><%=clist.get(j).getName()%></option>
				<% }%> 
				</select> &nbsp;&nbsp;专业：<select name="major">
						<%Session seMajor= HibernateUtil.getSession();
				List<Major> mlist =seMajor.createQuery("from Major").list();
				 HibernateUtil.clossSession(); 
				 for(int j=0;j<mlist.size();j++){%>
					 <option selected="selected" value="<%=mlist.get(j).getId()%>" ><%=mlist.get(j).getName()%></option>
				<% }%> 
				</select> &nbsp;&nbsp;层次：<select name="level">
						<%Session seLevel= HibernateUtil.getSession();
				List<Level> llist =seLevel.createQuery("from Level").list();
				 HibernateUtil.clossSession(); 
				 for(int j=0;j<llist.size();j++){%>
					 <option selected="selected" value="<%=llist.get(j).getId()%>" ><%=llist.get(j).getName()%></option>
				<% }%> 
				</select> &nbsp;&nbsp;年级：<select name="grade">
						<option selected="selected">大一</option>
						<option selected="selected">大二</option>
						<option selected="selected">大三</option>
						<option selected="selected">大四</option>
				</select> &nbsp;&nbsp;学年：<select name="acedemicYear">
						<option selected="selected">2001-2002</option>
						<option selected="selected">2002-2003</option>	
						<option selected="selected">2003-2004</option>	
						<option selected="selected">2004-2005</option>	
						<option selected="selected">2006-2007</option>	
						<option selected="selected">2007-2008</option>
				</select>
				</td>
			</tr>--%>
			<tr>
				<td width="5%" nowrap="nowrap">按出库时间查询：<input name="deliverDatefrm"
					type="text" class="input2" id="deliverDatefrm"/> 至 <input name="deliverDateto"
					type="text" class="input2" id="deliverDateto"/> <input name="Submit" type="submit"
					class="buttonInp" value="查 询" />
				</td>
			</tr>
		</table>

	</form>

	<table width="90%" border="0" align="center" cellpadding="0"
		cellspacing="0" class="table">
		<tr>
			<th width="15%" align="center" nowrap="nowrap" class="title2">学号</th>
			<th width="15%" align="center" nowrap="nowrap" class="title2">姓名</th>
			<th width="15%" align="center" nowrap="nowrap" class="title2">班级</th>
			<th width="15%" align="center" nowrap="nowrap" class="title2">操作员</th>
			<th width="15%" align="center" nowrap="nowrap" class="title2">领书时间</th>
			<th width="15%" align="center" nowrap="nowrap" class="title2">套书</th>
		</tr>
		<%List<DeliverToStudent> dToStudents=(List)request.getAttribute("dToStudents"); 
			if(dToStudents != null && !dToStudents.isEmpty()){
			for(int i=0;i<dToStudents.size();i++){%>
		<tr class="within2bg">
			<td align="center"><%=dToStudents.get(i).getStudent().getNumber() %></td>
			<td align="center"><%=dToStudents.get(i).getStudent().getSname() %></td>
			<td align="center"><%=dToStudents.get(i).getStudent().getBclass().getName()%></td>
			<td align="center"><%=dToStudents.get(i).getOperator().getName() %></td>
			<td align="center" class="font_hilite"><%=dToStudents.get(i).getDeliverTime()%></td>
			<td align="center" class="font_hilite"><a
				href="<%=path%>/DeliverToStudentServlet?status=queryDetialBook&id=<%=dToStudents.get(i).getPackageBook().getId()%>">详细信息</a></td>
		</tr>
		<%} 
			}%>
	</table>
</body>
</html>